﻿using System;
using Microsoft.Practices.ObjectBuilder;

namespace ProjectDan.CRM.Views
{
	public partial class MaintainLink : Microsoft.Practices.CompositeWeb.Web.UI.Page, IMaintainLinkView
	{
		private MaintainLinkPresenter _presenter;

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            btnUpdate.Click += new EventHandler(btnUpdate_Click);
        }

        void btnUpdate_Click(object sender, EventArgs e)
        {
            _presenter.Update();
        }

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!this.IsPostBack)
			{
				this._presenter.OnViewInitialized();
			}
			this._presenter.OnViewLoaded();
		}

		[CreateNew]
		public MaintainLinkPresenter Presenter
		{
			get
			{
				return this._presenter;
			}
			set
			{
				if(value == null)
					throw new ArgumentNullException("value");

				this._presenter = value;
				this._presenter.View = this;
			}
		}

		// TODO: Forward events to the presenter and show state to the user.
		// For examples of this, see the View-Presenter (with Application Controller) QuickStart:
		//	


        #region IMaintainLinkView Members

        public int ModelId
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion

        #region IMaintainLinkView Members


        public void Show(Common.LinkMaintainViewModel model)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IMaintainLinkView Members


        public void UpdateModel(Common.LinkMaintainViewModel model)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}

